package com.wust.supermarket.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wust.supermarket.dao.ProviderDao;
import com.wust.supermarket.domain.Provider;
import com.wust.supermarket.service.ProviderService;

@Service
public class ProviderServiceImpl implements ProviderService{
	@Resource
	private ProviderDao providerDao;
	public List<Provider> listAllProviders(){
		return providerDao.listAllProviders();
	}

    //通过ID查询供应商
    public Provider getProviderById(int providerId) {
    	return providerDao.getProviderById(providerId);
    }

    //插入供应商
    public int insertProvider(Provider provider) {
    	return providerDao.insertProvider(provider);
    }

    //修改供应商
    public int updateProvider(Provider provider) {
    	return providerDao.updateProvider(provider);
    }

    //删除供应商
    public int deleteProvider(int providerId) {
    	return providerDao.deleteProvider(providerId);
    }
  //查询所有已经下线的供应商
    public List<Provider> listProviderOffline(){
    	return providerDao.listProviderOffline();
    }
}
